<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = $show_scroll = $show_dialog = 1;
include $this->admin_tpl('header', 'admin');

?>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>content_addtop_new.js"></script>
<h3 style="padding-left: 20px;padding-top: 10px">
	<?php if($child_source == 1){?>
	<?php echo $reg_info['cn_name']?>——报名统计
	<a href="?m=reg_child&c=source&a=init" style="font-size:14px;color: #0000FF"><em>返回上一级</em></a>
	<?php }else{?>
	<?php echo $reg_info['title']?>——报名统计
	<a href="?m=reg_child&c=manage&a=init" style="font-size:14px;color: #0000FF"><em>返回上一级</em></a>
	<?php }?>
</h3>

<div class="subnav">

</div>
<div class="pad-lr-10">
	<form name="searchform" action="" method="get">
		<input type="hidden" value="reg_child" name="m">
		<input type="hidden" value="manage" name="c">
		<input type="hidden" value="reg_statistics" name="a">
		<?php if($child_source == 1){?>
		<input type="hidden" value="<?php echo $_GET['source_id']?>" name="source_id">
		<input type="hidden" value="<?php echo $_GET['source']?>" name="source">
		<input type="hidden" value="<?php echo $_GET['channel']?>" name="channel">
		<input type="hidden" value="<?php echo $_GET['child_source']?>" name="child_source">
		<?php }else{?>
		<input type="hidden" value="<?php echo $_GET['res_id']?>" name="res_id">
		<?php }?>
		<table width="100%" cellspacing="0" class="search-form">
			<tbody>
			<tr>
				<td>
					<div class="explain-col">
						<?php echo L('child_name');?>：<input name="name" type="text" value="<?php if(isset($_GET['name'])) {echo $_GET['name'];}?>"
										 class="input-text"  style='width: 200px;' placeholder='输入名字关键字可模糊查询...'/>&nbsp;<?php echo L('tel');?>：<input name="tel" type="text" value="<?php if(isset($_GET['tel'])) {echo $_GET['tel'];}?>"
										 class="input-text"  style='width: 200px;' placeholder='请输入手机号进行查询...'/>
										 &nbsp;是否已支付：<?php echo form::select(array('1'=>'是','2'=>'否'), $is_pay, $str = 'name = "is_pay"', '请选择');?>
						<input type="submit" name="search"  class="button" value="<?php echo L('search')?>" />
						<a style="float:right;cursor:pointer;" href="javascript:;" onclick="refreshData(2);refreshData(4);refreshData(6);" class="button">刷新数据</a>
					</div>
				</td>
			</tr>
			</tbody>
		</table>
	</form>

	<form name="myform" id="myform" action="" method="post" onsubmit="return confirm('<?php echo L('confirm')?>')">
		<div class="table-list">
			<table width="100%">
				<thead>
				<tr>
					<th width="20">ID</th>
					<th width="60">家长姓名</th>
					<th width="60"><?php echo L('child_name');?></th>
					<th width="100"><?php echo L('child_image');?></th>
					<th width="60"><?php echo L('gender')?></th>
					<th width="60"><?php echo L('birthday')?></th>
					<th width="100"><?php echo L('tel');?></th>
					<th width="100"><?php echo L('source');?></th>
					<th width="100"><?php echo L('number_full')?></th>
					<th width="80"><?php echo L('is_pay')?></th>
					<th width="120"><?php echo L('create_time');?></th>
					<th width="100"><?php echo L('operation');?></th>
				</tr>
				</thead>
				<tbody>
				<?php
				if(!empty($info)){
					if(is_array($info)) {
	
						foreach ($info as $k=> $r) {
							?>
							<tr>
								<td align="center"><?php echo $r['id']?></td>
								<td align='center'><?php echo $r['mather_name']?></td>
								<td align='center'><?php echo $r['child_name']?></td>
								<td align='center' ><?php if(!empty($r['child_image'])){?><a href="javascript:image_priview('<?=$r['child_image']?>');"><?php echo '<img src="'.$r['child_image'].'" height="60px" title="点击可预览：'.$r['child_name'].'的照片！">';?></a><?php }else{echo '<font color="red">（未设置）</font>';}?></td>
								<td align='center' ><?php if($r['gender']==1){echo '男';}elseif($r['gender']==2){echo '女';}elseif($r['gender']==3){echo '保密';}else{echo '<font color="red">（未设置）</font>';}?></td>
								<td align='center' ><?php if(!empty($r['birthday'])){echo $r['birthday'];}else{echo '<font color="red">（未设置）</font>';}?></td>
								<td align='center'><?php if(!empty($r['tel'])){echo $r['tel'];}else{echo "<font color='red'>未设置</font>";}?></td>
								<td align='center'><?php if(!empty($r['source'])){echo $r['source'];}else{echo "<font color='red'>未设置</font>";}?></td>
								<td align='center'><?php if($r['number_full']!=''){echo $r['number_full'];}else{echo '<font color="red">（未设置）</font>';}?></td>
								<td align='center'><?php if($r['is_pay'] != ""){if($r['is_pay']==0){echo '<span style="color:red;font-weight:bolder">未支付</span>';}elseif($r['is_pay']==1){echo '<span style="color:green;font-weight:bolder">已支付</span>';}}else{echo '<font color="red">（未设置）</font>';}?></td>
								<td align='center'><?php if(!empty($r['create_time'])){echo $r['create_time'];}else{echo "<font color='red'>未设置</font>";}?></td>
								<td align='center'>
								<?php if($child_source==1){?>
									<a href="?m=reg_child&c=manage&a=reg_statistics_detail&id=<?php echo $r['id']?>&source_id=<?php echo $id?>&child_source=1&source=<?php echo $source?>&channel=<?php echo $channel?>">查看详情</a>
									<?php }else{?>
									<a href="javascript:edit('<?php echo $r['id'];?>','<?php echo $r['child_name'];?>')">修改</a>&nbsp;|&nbsp;
									<a href="?m=reg_child&c=manage&a=reg_statistics_detail&id=<?php echo $r['id']?>&res_id=<?php echo $reg_id?>">查看详情</a>
									<?php }?>
								</td>
							</tr>
						<?php }
					}
				}else{
				?>
					<tr><td colspan='11' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>
				<?php }?>
				</tbody>
			</table>
			<div id="pages"><?php echo $pages;?></div>
		</div>
	</form>
</div>
</body>
</html>
<script>
    function edit(id, name) {
    	window.top.art.dialog({id:'edit'}).close();
    	window.top.art.dialog({title:'修改：'+name+'的照片',id:'edit',iframe:'?m=reg_child&c=manage&a=reg_statistics_edit&pc_hash=pNlSgG&id='+id,width:'600',height:'200'},  function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
    }
</script>